#include "ExpConfig.h"
#include "logManager.h"
#include "netSocket.h"

ExpConfig* gExpConfig = F_NULL;


ExpConfig::ExpConfig()
{
	gExpConfig = this;
}


ExpConfig::~ExpConfig()
{

}

fvoid		ExpConfig::Load( const fbyte* path )
{
    ptree pt;
    ptree root;
    
    read_xml( path , pt , boost::property_tree::xml_parser::trim_whitespace );
    
    FLOG4( "xml loading. %s" , path );
    
    root = pt.get_child( "root" );
    
    ptree::assoc_iterator iter = root.ordered_begin();
    ++iter;
    
    for (  ; iter != root.not_found() ; ++iter )
    {
        ptree n = iter->second;
        
        fint32 level , exp;
        
        level = n.get< fint32 >( "<xmlattr>.level" );
        exp = n.get< fint32 >( "<xmlattr>.exp" );
        
        EXP[ level ] = exp;
    }
    
    FLOG4( "xml loaded. %s" , path );
}
